﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Engine
{
    
    /*
     * helper class that contain array of Bond 
     */
    public class Bonds
    {
        /** list of all working bond in net */
        private IList<Bond> bonds;

        public Bonds()
        {
            bonds = new List<Bond>();
        }

        public IList<Bond> BondList 
        {
            get 
            {
                return bonds;
            }
        }

        public Bond this[int index]
        {
            get { return bonds[index]; }
            set { bonds[index] = value; }
        }

        public int Count 
        {
            get { return bonds.Count; }
        }

        public void Remove(Bond bond) 
        {
            bonds.Remove(bond);
        }

        public void Add(Bond bond)
        {
            bonds.Add(bond);
        }

        /**
         * this method helps to determine if we have bond beetween two points  
         */
        public bool isConduct(int x1, int y1, int x2, int y2) 
        {
            Bond bond = new Bond(x1, y1, x2, y2);
            return bonds.Contains(bond);
        }

        public bool isConduct(int x1,int y1,int z1,int x2,int y2,int z2)
        { 
            Bond bond = new Bond(x1,y1,z1,x2,y2,z2);
            return bonds.Contains(bond);    
        }
    }
}
